package com.huluobo.a2301mdmdemo.video

import com.huluobo.a2301mdmdemo.video.entity.CommentEntity
import com.huluobo.a2301mdmdemo.video.entity.VideoEntity
import com.huluobo.lib_base.Res
import com.huluobo.lib_http.Const
import kotlinx.coroutines.flow.Flow
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

/**
 *  Created by LC on 2025/7/3.
 */
interface ApiService {
    @GET(Const.URL_GET_VIDEOS)
    fun getVideos(
        @Query(Const.PARAM_CURRENT_PAGE) currentPage: Int,
        @Query(Const.PARAM_PAGE_SIZE) pageSize: Int
    ): Flow<Res<VideoEntity>>

    @POST(Const.URL_LIKE_VIDEO)
    fun likeVideo(@Query(Const.PARAM_VIDEO_ID) videoId: Int): Flow<Res<Any>>

    @POST(Const.URL_NO_LIKE_VIDEO)
    fun noLikeVideo(@Query(Const.PARAM_VIDEO_ID) videoId: Int): Flow<Res<Any>>

    @GET(Const.URL_GET_COMMENTS)
    fun getComments(@Query(Const.PARAM_VIDEO_ID) videoId: Int): Flow<Res<CommentEntity>>

    @POST(Const.URL_SEND_COMMENT)
    fun sendComment(@Body body: RequestBody): Flow<Res<CommentEntity>>
}